[Chapter 31] 31.7 Categories of Macros
Author: Bryan Costales & Eric Allman
Date: 1999-01-06T20:11:22Z

#

| Chapter 31 Defined Macros |

## 31.7 Categories of Macros

At the end of this chapter we list all the macros in alphabetical order for easy lookup and explain each in detail. Here, we present them grouped by application with only a brief description.

### 31.7.1 Macros and the System Identity

The nature of email addresses requires that sendmail have a firm understanding of the machine on which it is running. The `-d0.4` debugging switch (see Section 37.5.2, -d0.4) causes sendmail to print its understanding of what the local machine is. A portion of that output displays the value of four key macros:

>     ============ SYSTEM IDENTITY (after readcf) ============
>           (short domain name) $w = here
>       (canonical domain name) $j = here.our.domain
>              (subdomain name) $m = our.domain
>                   (node name) $k = here
>     ========================================================

The short domain name (in `$w`; see Section 31.10.40) is simply the name of the local host without any domain information added as a suffix. The canonical domain name (in `$j`; see Section 31.10.20) is the fully qualified and official name of the local machine. The subdomain name (in `$m`; see Section 31.10.24) is just the domain part of the canonical name without a leading dot. And the node name (in `$k`; see Section 31.10.21) is the UUCP name of the local machine.

In addition to these macros, sendmail initializes the class `$=w` with a list of alternative names for the local host (see Section 32.5.8, $=w) and class `$=m` with a list of the local domains (see Section 32.5.3, $=m).

### 31.7.2 Macros and the Date

The concept of time can take on different meanings depending on whether we are talking about the sender, the recipient, the remote machine, or the local machine. To keep different times separate, sendmail employs an assortment of macros, as shown in Table 31.4.

Table 31.4: Macros That Store Dates
Macro |  | Description
--- | --- | ---
`$a` | Section 31.10.2, $a | The origin date in RFC822 format
`$b` | Section 31.10.3 | The current date in RFC822 format
`$d` | Section 31.10.10, $d | The current date in UNIX ctime(3) format
`$t` | Section 31.10.35, $t | Current time in seconds

31.6 Macro Conditionals: $?, $|, and $. |  | 31.8 Macros with the m4 Technique